<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.11"/>
<title>eRPC Generator (erpcgen): PathSearcher Class Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
  $(document).ready(initResizable);
  $(window).load(resizeHeight);
</script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
  $(document).ready(function() { init_search(); });
</script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
<link href="customdoxygen.css" rel="stylesheet" type="text/css"/>
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectlogo"><img alt="Logo" src="nxp_logo_small.png"/></td>
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">eRPC Generator (erpcgen)
   &#160;<span id="projectnumber">Rev. 1.7.2</span>
   </div>
   <div id="projectbrief">NXP Semiconductors</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.11 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li class="current"><a href="annotated.html"><span>Classes</span></a></li>
      <li><a href="files.html"><span>Files</span></a></li>
      <li>
        <div id="MSearchBox" class="MSearchBoxInactive">
        <span class="left">
          <img id="MSearchSelect" src="search/mag_sel.png"
               onmouseover="return searchBox.OnSearchSelectShow()"
               onmouseout="return searchBox.OnSearchSelectHide()"
               alt=""/>
          <input type="text" id="MSearchField" value="Search" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)" 
               onblur="searchBox.OnSearchFieldFocus(false)" 
               onkeyup="searchBox.OnSearchFieldChange(event)"/>
          </span><span class="right">
            <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
          </span>
        </div>
      </li>
    </ul>
  </div>
  <div id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="annotated.html"><span>Class&#160;List</span></a></li>
      <li><a href="classes.html"><span>Class&#160;Index</span></a></li>
      <li><a href="hierarchy.html"><span>Class&#160;Hierarchy</span></a></li>
      <li><a href="functions.html"><span>Class&#160;Members</span></a></li>
    </ul>
  </div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
$(document).ready(function(){initNavTree('class_path_searcher.html','');});
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div class="header">
  <div class="summary">
<a href="#pub-types">Public Types</a> &#124;
<a href="#pub-methods">Public Member Functions</a> &#124;
<a href="#pub-static-methods">Static Public Member Functions</a> &#124;
<a href="#pro-types">Protected Types</a> &#124;
<a href="#pro-methods">Protected Member Functions</a> &#124;
<a href="#pro-attribs">Protected Attributes</a> &#124;
<a href="#pro-static-attribs">Static Protected Attributes</a> &#124;
<a href="class_path_searcher-members.html">List of all members</a>  </div>
  <div class="headertitle">
<div class="title">PathSearcher Class Reference</div>  </div>
</div><!--header-->
<div class="contents">

<p>Handles searching a list of paths for a file.  
 <a href="class_path_searcher.html#details">More...</a></p>

<p><code>#include &lt;<a class="el" href="_search_path_8h_source.html">SearchPath.h</a>&gt;</code></p>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-types"></a>
Public Types</h2></td></tr>
<tr class="memitem:ac28f2355c7999501e3150fd0e575db14"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ac28f2355c7999501e3150fd0e575db14"></a>enum &#160;</td><td class="memItemRight" valign="bottom"><b>_target_type</b> { <br />
&#160;&#160;<b>kFindFile</b>, 
<br />
&#160;&#160;<b>kFindDirectory</b>
<br />
 }</td></tr>
<tr class="separator:ac28f2355c7999501e3150fd0e575db14"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ab2a0b67049e737e4558ad5d62147b0d9"><td class="memItemLeft" align="right" valign="top">typedef enum _target_type&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_path_searcher.html#ab2a0b67049e737e4558ad5d62147b0d9">target_type_t</a></td></tr>
<tr class="separator:ab2a0b67049e737e4558ad5d62147b0d9"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-methods"></a>
Public Member Functions</h2></td></tr>
<tr class="memitem:a0a2b1157faa1145b87258e65b7c2d8df"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a0a2b1157faa1145b87258e65b7c2d8df"></a>
&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_path_searcher.html#a0a2b1157faa1145b87258e65b7c2d8df">PathSearcher</a> ()</td></tr>
<tr class="memdesc:a0a2b1157faa1145b87258e65b7c2d8df"><td class="mdescLeft">&#160;</td><td class="mdescRight">Constructor. <br /></td></tr>
<tr class="separator:a0a2b1157faa1145b87258e65b7c2d8df"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:af9554bf75313b8d268db3b642e0c4008"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="af9554bf75313b8d268db3b642e0c4008"></a>
void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_path_searcher.html#af9554bf75313b8d268db3b642e0c4008">addSearchPath</a> (const std::string &amp;path)</td></tr>
<tr class="memdesc:af9554bf75313b8d268db3b642e0c4008"><td class="mdescLeft">&#160;</td><td class="mdescRight">Add a new search path to the end of the list. <br /></td></tr>
<tr class="separator:af9554bf75313b8d268db3b642e0c4008"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:adae60e58362ae0098ffdc8fbf1b9e007"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="adae60e58362ae0098ffdc8fbf1b9e007"></a>
void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_path_searcher.html#adae60e58362ae0098ffdc8fbf1b9e007">setTempPath</a> (const std::string &amp;path)</td></tr>
<tr class="memdesc:adae60e58362ae0098ffdc8fbf1b9e007"><td class="mdescLeft">&#160;</td><td class="mdescRight">Set temporary path. <br /></td></tr>
<tr class="separator:adae60e58362ae0098ffdc8fbf1b9e007"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a32c8f23e9994995e464722ea07bd0529"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_path_searcher.html#a32c8f23e9994995e464722ea07bd0529">search</a> (const std::string &amp;base, <a class="el" href="class_path_searcher.html#ab2a0b67049e737e4558ad5d62147b0d9">target_type_t</a> targetType, bool searchCwd, std::string &amp;result)</td></tr>
<tr class="memdesc:a32c8f23e9994995e464722ea07bd0529"><td class="mdescLeft">&#160;</td><td class="mdescRight">Attempts to locate a file by using the search paths.  <a href="#a32c8f23e9994995e464722ea07bd0529">More...</a><br /></td></tr>
<tr class="separator:a32c8f23e9994995e464722ea07bd0529"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-static-methods"></a>
Static Public Member Functions</h2></td></tr>
<tr class="memitem:a2d808911bacf77ecb43afd7f3de08a8e"><td class="memItemLeft" align="right" valign="top">static <a class="el" href="class_path_searcher.html">PathSearcher</a> &amp;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_path_searcher.html#a2d808911bacf77ecb43afd7f3de08a8e">getGlobalSearcher</a> ()</td></tr>
<tr class="memdesc:a2d808911bacf77ecb43afd7f3de08a8e"><td class="mdescLeft">&#160;</td><td class="mdescRight">Access global path searching object.  <a href="#a2d808911bacf77ecb43afd7f3de08a8e">More...</a><br /></td></tr>
<tr class="separator:a2d808911bacf77ecb43afd7f3de08a8e"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pro-types"></a>
Protected Types</h2></td></tr>
<tr class="memitem:a63744c70ba23ec6b7ba57e8cc6ea2fea"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a63744c70ba23ec6b7ba57e8cc6ea2fea"></a>
typedef std::list&lt; std::string &gt;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_path_searcher.html#a63744c70ba23ec6b7ba57e8cc6ea2fea">string_list_t</a></td></tr>
<tr class="memdesc:a63744c70ba23ec6b7ba57e8cc6ea2fea"><td class="mdescLeft">&#160;</td><td class="mdescRight">Linked list of strings. <br /></td></tr>
<tr class="separator:a63744c70ba23ec6b7ba57e8cc6ea2fea"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pro-methods"></a>
Protected Member Functions</h2></td></tr>
<tr class="memitem:a5d9ed7d522f86c5c9f28ee392859215d"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a5d9ed7d522f86c5c9f28ee392859215d"></a>
bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_path_searcher.html#a5d9ed7d522f86c5c9f28ee392859215d">isAbsolute</a> (const std::string &amp;path)</td></tr>
<tr class="memdesc:a5d9ed7d522f86c5c9f28ee392859215d"><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns whether <em>path</em> is absolute. <br /></td></tr>
<tr class="separator:a5d9ed7d522f86c5c9f28ee392859215d"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ae28b10bb9bf2c700244a9e1b17f7d1e3"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ae28b10bb9bf2c700244a9e1b17f7d1e3"></a>
std::string&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_path_searcher.html#ae28b10bb9bf2c700244a9e1b17f7d1e3">joinPaths</a> (const std::string &amp;first, const std::string &amp;second)</td></tr>
<tr class="memdesc:ae28b10bb9bf2c700244a9e1b17f7d1e3"><td class="mdescLeft">&#160;</td><td class="mdescRight">Combines two paths into a single one. <br /></td></tr>
<tr class="separator:ae28b10bb9bf2c700244a9e1b17f7d1e3"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pro-attribs"></a>
Protected Attributes</h2></td></tr>
<tr class="memitem:a7a90afcb04c4b53f299123b969afea4f"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a7a90afcb04c4b53f299123b969afea4f"></a>
<a class="el" href="class_path_searcher.html#a63744c70ba23ec6b7ba57e8cc6ea2fea">string_list_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_path_searcher.html#a7a90afcb04c4b53f299123b969afea4f">m_paths</a></td></tr>
<tr class="memdesc:a7a90afcb04c4b53f299123b969afea4f"><td class="mdescLeft">&#160;</td><td class="mdescRight">Ordered list of paths to search. <br /></td></tr>
<tr class="separator:a7a90afcb04c4b53f299123b969afea4f"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:af0457aa7e4e966a830a60bda2c106139"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="af0457aa7e4e966a830a60bda2c106139"></a>
std::string&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_path_searcher.html#af0457aa7e4e966a830a60bda2c106139">m_tempPath</a></td></tr>
<tr class="memdesc:af0457aa7e4e966a830a60bda2c106139"><td class="mdescLeft">&#160;</td><td class="mdescRight">Possibility to add temporary path. <br /></td></tr>
<tr class="separator:af0457aa7e4e966a830a60bda2c106139"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pro-static-attribs"></a>
Static Protected Attributes</h2></td></tr>
<tr class="memitem:a8bf0b820c7cccbdda02214ca626e9ac5"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a8bf0b820c7cccbdda02214ca626e9ac5"></a>
static <a class="el" href="class_path_searcher.html">PathSearcher</a> *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_path_searcher.html#a8bf0b820c7cccbdda02214ca626e9ac5">s_searcher</a></td></tr>
<tr class="memdesc:a8bf0b820c7cccbdda02214ca626e9ac5"><td class="mdescLeft">&#160;</td><td class="mdescRight">Global search object singleton. <br /></td></tr>
<tr class="separator:a8bf0b820c7cccbdda02214ca626e9ac5"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><p>Handles searching a list of paths for a file. </p>
</div><h2 class="groupheader">Member Typedef Documentation</h2>
<a class="anchor" id="ab2a0b67049e737e4558ad5d62147b0d9"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">typedef enum _target_type <a class="el" href="class_path_searcher.html#ab2a0b67049e737e4558ad5d62147b0d9">PathSearcher::target_type_t</a></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Type of searched item. </p>

</div>
</div>
<h2 class="groupheader">Member Function Documentation</h2>
<a class="anchor" id="a2d808911bacf77ecb43afd7f3de08a8e"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="class_path_searcher.html">PathSearcher</a> &amp; PathSearcher::getGlobalSearcher </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Access global path searching object. </p>
<p>This function will create the global path search object if it has not already been created. </p>

</div>
</div>
<a class="anchor" id="a32c8f23e9994995e464722ea07bd0529"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">bool PathSearcher::search </td>
          <td>(</td>
          <td class="paramtype">const std::string &amp;&#160;</td>
          <td class="paramname"><em>base</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="class_path_searcher.html#ab2a0b67049e737e4558ad5d62147b0d9">target_type_t</a>&#160;</td>
          <td class="paramname"><em>targetType</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">bool&#160;</td>
          <td class="paramname"><em>searchCwd</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">std::string &amp;&#160;</td>
          <td class="paramname"><em>result</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Attempts to locate a file by using the search paths. </p>
<p>The <em>base</em> path argument can be either a relative or absolute path. If the path is relative, then it is joined with search paths one after another until a matching file is located or all search paths are exhausted. If the <em>base</em> is absolute, only that path is tested and if invalid false is returned.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir"></td><td class="paramname">base</td><td>A path to the file that is to be found. </td></tr>
    <tr><td class="paramdir"></td><td class="paramname">targetType</td><td>Currently ignored. In the future it will let you select whether to find a file or directory. </td></tr>
    <tr><td class="paramdir"></td><td class="paramname">searchCwd</td><td>If set to true, the current working directory is searched before using any of the search paths. Otherwise only the search paths are considered. </td></tr>
    <tr><td class="paramdir">[out]</td><td class="paramname">result</td><td>When true is returned this string is set to the first path at which a valid file was found.</td></tr>
  </table>
  </dd>
</dl>
<dl class="retval"><dt>Return values</dt><dd>
  <table class="retval">
    <tr><td class="paramname">true</td><td>A matching file was found among the search paths. The contents of <em>result</em> are a valid path. </td></tr>
    <tr><td class="paramname">false</td><td>No match could be made. <em>result</em> has been left unmodified. </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<hr/>The documentation for this class was generated from the following files:<ul>
<li><a class="el" href="_search_path_8h_source.html">SearchPath.h</a></li>
<li>SearchPath.cpp</li>
</ul>
</div><!-- contents -->
</div><!-- doc-content -->
<!-- HTML footer for doxygen 1.8.5-->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
  <ul class="foot">
    <li class="footer">&copy; 2016 NXP Semiconductors. All rights reserved.
    </li>
  </ul>
</div>
</body>
</html>
